package com.seecen.controller;


import com.seecen.entity.Person;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api")
public class RestfulController {

    @PostMapping("{age}/add/{username}/")
    public String add(@PathVariable("username") String username
    , @PathVariable("age") int age) {
        return "hello" + username + age;
    }

    @RequestMapping("/get")
    public Person get(Person person) {
        return person;
    }

    @RequestMapping("/get2")
    public Person get2(@RequestBody Person person) {
        return person;
    }

    @RequestMapping("/get3")
    public List<Person> get3(@RequestBody List<Person> persons) {
        return persons;
    }
}
